<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>改变Promise的状态</title>
</head>
<body>
<script>
    let p = new Promise((resolve, reject) => {
        //1. resolve函数
        resolve('ok');//pending -> fulfilled (resolved)
        //2. reject函数
        reject('error');//pending => reject
        //3.抛出错误
        throw 'Error';//pending => reject
    })
</script>
</body>
</html>
